{include file="public/head"/}
<div class="layui-fluid">
    <div class="layui-row layui-col-space15">
        <div class="layui-col-md12">
            <div class="layui-card">
                <div class="layui-card-header">微信配置</div>
                <div class="layui-card-body">
                    <div class="layui-form" wid100 lay-filter="form">
                        <div class="layui-form-item">
                            <label class="layui-form-label">AppID</label>
                            <div class="layui-input-inline" style="width: 300px;">
                                <input type="text" name="app_id" class="layui-input">
                            </div>
                            <div class="layui-form-mid layui-word-aux">微信公众号AppID</div>
                        </div>
                        <div class="layui-form-item">
                            <label class="layui-form-label">AppSecret</label>
                            <div class="layui-input-inline" style="width: 300px;">
                                <input type="text" name="secret" class="layui-input">
                            </div>
                            <div class="layui-form-mid layui-word-aux">微信公众号AppSecret</div>
                        </div>
                        <div class="layui-form-item">
                            <label class="layui-form-label">商户号</label>
                            <div class="layui-input-inline" style="width: 300px;">
                                <input type="text" name="mch_id" class="layui-input">
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <label class="layui-form-label">Key</label>
                            <div class="layui-input-inline" style="width: 300px;">
                                <input type="text" name="key" class="layui-input">
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <div class="layui-input-block">
                                <button class="layui-btn" lay-submit lay-filter="set_system_wechat">确认保存</button>
                            </div>
                        </div>

                    </div>

                </div>
            </div>
        </div>
    </div>
</div>
{include file="public/foot"/}
<script>
    layui.config({
        base: '__LAYDMIN__/',{if config('app.app_debug')}version: true{/if}
    }).extend({
        index: 'lib/index' //主入口模块
    }).use(['index','form','admin'],function(){
        var form = layui.form, admin = layui.admin;
        form.val("form", {$info|raw})
		//提交
		form.on('submit(set_system_wechat)', function (obj) {
			admin.req({
				url: '{:url(SYS_PATH."/".CONTROLLER."/wechat")}'
				, data: obj.field
				,type:'post'
				, success: function (res) {
						if(res.code==0){
							 window.top.layer.msg(res.msg, {icon: 1, time: 1000,shade:[0.5,'#000']});
						}else{
							window.top.layer.msg(res.msg, {icon: 2, time: 1000,shade:[0.5,'#000']});
						}
				}
			});
			return false;
		});
		

    });
</script>
</body>
</html>